<%--
  Created by IntelliJ IDEA.
  User: XBB
  Date: 2021/2/25
  Time: 17:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>

<div id="container" style="height: 100%"></div>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/echarts.js"></script>

<script>
    var dom = document.getElementById("container");
    var myChart = echarts.init(dom);
    var app = {};
    var option;
    $(function () {
        $.post("${pageContext.request.contextPath}/stat/customerStatJson",function (r) {

            option = {
                backgroundColor: '#2c343c',
                textStyle: {
                    color: '#ffffff'
                },
                title: {
                    text: '客户地区统计',
                    subtext: '真实有效',
                    textStyle: {
                        color: '#ffffff'
                    },
                    left: 'center'
                },
                tooltip: {
                    trigger: 'item'
                },
                legend: {
                    orient: 'vertical',
                    left: 'left',
                    textStyle: {
                        color: '#ffffff',
                    },
                },
                series: [
                    {
                        name: '客户数量(占比)',
                        textStyle: {
                            color: '#ffffff'
                        },
                        type: 'pie',
                        roseType: 'angle',
                        width:'1000px',
                        height:'1000px',
                        radius: '50%',
                        left: 'center',
                        data: r.data,
                        emphasis: {
                            itemStyle: {
                                shadowBlur: 10,
                                shadowOffsetX: 0,
                                shadowColor: 'rgba(0, 0, 0, 0.5)'
                            }
                        }
                    }
                ]
            };

            if (option && typeof option === 'object') {
                myChart.setOption(option);
            }
        })
    })
</script>
</body>
</html>
